package cn.wolfcode.crm.mapper;

import cn.wolfcode.crm.domain.Member;
import cn.wolfcode.crm.query.MemberQueryObject;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;

public interface MemberMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Member record);

    Member selectByPrimaryKey(Long id);

    List<Member> selectAll();

    int updateByPrimaryKey(Member record);

    //高级查询
    List<Member> query(MemberQueryObject qo);

    Integer count(MemberQueryObject qo);

    void updateByClientId(@Param("clientId") Long clientId,@Param("memberId") Long memberId);

    Long selectByCardNum(String cardNumber);

    Integer selectBirthday(Date dd);

    Integer selectBirthdayByMonth(int i);

    Integer selectCount();

    void changeType(Long id);

    Member selectByMemberClientId(Long id);

    Member selectByRechargeTimeId(Long id);

    void updateByRechargeId(@Param("rechargeId")Long rechargeId,@Param("memberId") Long memberId);

    int validateName(String cardNumber);
    //根据卡号查询会员信息
    Member selectMemberInfoByCardNum(String cardNumber);

    void updatePoint(Member key);

    void updateNumber(Member key);

    List<Member> selectByChangeKey();

    List<Map<String, Object>> orderByAmount();

    BigDecimal selectByTotalAmount(String cardNumber);

    void updateNewPoint(Member member);

    Member selectByPGiftKey(Long d);


    List<Member> selectAllByShopName(MemberQueryObject qo);

    void updateBalanceByPrimaryKey(Member key);
}